import yaml

from weixin_po.commom.BasePage import BasePage
from weixin_po.page_object.home_page import Homepage
from weixin_po.utils.log_util import logger


class login(BasePage):
    def login(self):
        """登录"""
        logger.info("登录")
        self.get_url()
        # with open("../data/cookies.yaml", "r") as f:
        #     cookies = yaml.safe_load(f)
        #     for cookie in cookies:
        #         self.driver.add_cookie(cookie)
        # self.get_url()
        self.driver.implicitly_wait(20)
        return Homepage(self.driver)
